﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace UI
{
    public partial class AddEditRemoveButtonControl : UserControl
    {
        public delegate void AddPress();
        public delegate void EditPress();
        public delegate void RemovePress();
        

        public event AddPress AddKeyPressedEvent;
        public event EditPress EditKeyPressedEvent;
        public event RemovePress RemoveKeyPressedEvent;


        MainForm_EventHandler mainFormEventHandler;
        public AddEditRemoveButtonControl()
        {
            mainFormEventHandler = new MainForm_EventHandler();
            
            InitializeComponent();
               
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
           switch (MainForm_EventHandler.SelectedIndex)
           {
               case 0:
                   AddKeyPressedEvent += mainFormEventHandler.ShowFormAddVariables;
                   AddKeyPressedEvent();
                   AddKeyPressedEvent -= mainFormEventHandler.ShowFormAddVariables;
                   break;

               case 1: 
                   AddKeyPressedEvent +=mainFormEventHandler.ShowFormAddEvents;
                   AddKeyPressedEvent();
                   AddKeyPressedEvent -= mainFormEventHandler.ShowFormAddEvents;
                   break;

               case 2: 
                   AddKeyPressedEvent +=mainFormEventHandler.ShowFormAddOperations;
                   AddKeyPressedEvent();
                   AddKeyPressedEvent -= mainFormEventHandler.ShowFormAddOperations;
                   break;

               case 3:
                   AddKeyPressedEvent +=mainFormEventHandler.ShowFormAddBindings;
                   AddKeyPressedEvent();
                   AddKeyPressedEvent -= mainFormEventHandler.ShowFormAddBindings;
                   break;
           }
        }

        private void btnEdit_Click(object sender, EventArgs e)
        {
           
            //Edit
            switch (MainForm_EventHandler.SelectedIndex)
            {
                case 0:
                    AddKeyPressedEvent += mainFormEventHandler.ShowFormEditVariables;
                    AddKeyPressedEvent();
                    AddKeyPressedEvent -= mainFormEventHandler.ShowFormEditVariables;
                    break;

                case 1:
                    AddKeyPressedEvent += mainFormEventHandler.ShowFormEditEvents;
                    AddKeyPressedEvent();
                    AddKeyPressedEvent -= mainFormEventHandler.ShowFormEditEvents;
                    /// Events
                    break;

                case 2:
                    /// Operations
                    break;

                case 3:
                    /// Bindings
                    break;
            }
        }

        private void btnRemove_Click(object sender, EventArgs e)
        {
            //Remove
            switch (MainForm_EventHandler.SelectedIndex)
            {
                case 0:
                    
                    //Program.m.clientDataset.
                    
                    
                    break;

                case 1:
                    /// Events
                    break;

                case 2:
                    /// Operations
                    break;

                case 3:
                    /// Bindings
                    break;
            }
        }
    }
}
